package com.neuedu.it.teach.service.impl;

import com.neuedu.it.teach.dao.UserDao;
import com.neuedu.it.teach.entity.User;
import com.neuedu.it.teach.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserDao userDao;
    @Override
    public User login(String username, String password) {
        return userDao.queryByNameAndPwd(username,password);
    }

    @Override
    @Transactional
    public User register(User user) {
        userDao.insertUser(user);
        return user;
    }
}
